/**
 * Created with IntelliJ IDEA.
 * Description: Java程序设计面向对象（下）实验代码题目一
 */
class Student{
    protected String name;
    protected int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void show() {
        System.out.println("name：" + this.name + " age：" + this.age);
    }
}

class Undergraduate extends Student {
    protected String degree;

    public Undergraduate(String name, int age, String degree) {
        super(name, age);
        this.degree = degree;
    }

    @Override
    public void show() {
        System.out.println("name：" + super.name + " age：" + super.age +
                " degree：" + this.degree);
    }
}


public class Example01 {
    public static void main(String[] args) {
        Student student = new Student("张三",16);
        Undergraduate undergraduate =
                new Undergraduate("李四",20,"bechelor");
        student.show();
        undergraduate.show();
    }
}
